#pragma once
#ifndef TypesDef_h
#define TypesDef_h

#include<stdlib.h>

//
//  typesdef.hpp
//  JanMalloc
//
//  Created by janhit on 2022/4/16.
//


namespace MMFAlloc{

using i8 = char;
using u8 = unsigned char;
using i16 = short;
using u16 = unsigned short;
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

}


#ifndef PAGE_SIZE
#define PAGE_SIZE 4096
#endif


#ifdef WIN32

inline void* aligned_alloc(size_t alignment, size_t size)
{
    return _aligned_malloc(size, alignment);
}

inline void aligned_free(void* addr)
{
    _aligned_free(addr);
}

#else 

inline void aligned_free(void* addr)
{
    free(addr);
}


#endif


#endif /* TypesDef_h */
